package com.corechina.apex_osswords.common;

import com.corechina.apex_osswords.domain.vo.CoreWeiXinUserInfoVo;
import org.apache.shiro.SecurityUtils;

/**
 * @program: apex_osswords
 * @description: 微信用户工具类
 * @author: cc
 * @create: 2022-03-30 15:37
 **/
public class WeiXinUserUtils {

    public static CoreWeiXinUserInfoVo getUserEntity() {
        return (CoreWeiXinUserInfoVo) SecurityUtils.getSubject().getPrincipal();
    }

    public static Integer getUserId() {
        return getUserEntity().getId();
    }

    public static Integer getUserType() {
        return getUserEntity().getUserType();
    }

    public static Integer getEnterpriseId(){
        return getUserEntity().getEnterpriseId();
    }
}
